import axios from '@/utils/axios';

// 获取供应商列表
export const supplierList = (params) => {
  return axios({
    url: '/supplier/list',
    method: 'get',
    params
  })
};

// 添加供应商
export const supplierAdd = (data) => {
  return axios({
    url: '/supplier/add',
    method: 'post',
    data
  })
};


// 删除供应商
export const supplierDelete = (id) => {
  return axios({
    url: '/supplier/delete/' + id,
    method: 'delete'
  })
};

// 根据id获取供应商详情
export const supplierDetail = (id) => {
  return axios({
    url: '/supplier/detail/' + id,
    method: 'get'
  })
};

// 编辑供应商
export const supplierUpdate = (data) => {
  return axios({
    url: '/supplier/update',
    method: 'post',
    data
  })
};
// 获取所有供应商
export const getAllSupplier = () => {
  return axios({
    url: '/supplier/all',
    method: 'get'
  })
};